//
//  XHRTreatedMethodViewController.m
//  快医
//
//  Created by 胥鸿儒 on 16/7/11.
//
//

#import "XHRTreatedMethodViewController.h"
@interface XHRTreatedMethodViewController()

/**存放治疗方式的数组*/
@property(nonatomic,strong)NSArray *treatedMethodArray;

@end
@implementation XHRTreatedMethodViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    [self initSettings];
}
- (void)initSettings
{
    self.tableView.tableFooterView = [[UIView alloc]init];
}

#pragma mark -
#pragma mark - tableView dataSoruce
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return self.treatedMethodArray.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *const treatedMethodViewID = @"treatedMethodViewID";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:treatedMethodViewID];
    if (!cell) {
        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:treatedMethodViewID];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    cell.textLabel.text = self.treatedMethodArray[indexPath.row];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (self.treatedMethodBlock) {
        self.treatedMethodBlock(self.treatedMethodArray[indexPath.row]);
    }
    [self.navigationController popViewControllerAnimated:YES];
}

- (NSArray *)treatedMethodArray
{
    if (!_treatedMethodArray) {
        _treatedMethodArray = @[@"保守治疗",@"药物治疗",@"手术治疗"];
    }
    return _treatedMethodArray;
}
@end
